﻿using QLBH.DATA;
using QLBH.DTO;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace QLBH.BUSINESS
{
    public class SanPhamBus
    {
        private static SanPhamData db = new SanPhamData();
        public static List<SAN_PHAM> TimSanPhamTheoTen(string ten_san_pham, int tong_so_dong)
        {
            return db.TimSanPhamTheoTen(ten_san_pham, tong_so_dong);
        }

        public static string ThemMoi(SANPHAMPARAM SanPham)
        {
            if (db.ThemMoi(SanPham))
            {
                return "1";
            }
            else
                return db.Error;
        }

        public static string CapNhat(SANPHAMPARAM SanPham)
        {
            if (db.CapNhat(SanPham))
            {
                return "1";
            }
            else
                return db.Error;
        }

        public static string Xoa(string[] MA_SAN_PHAM)
        {
            if (db.Xoa(MA_SAN_PHAM))
            {
                return "1";
            }
            else
                return db.Error;
        }
    }
}